public class 水仙花2 {
    public static void main(String[] args) {
        int count = 0;

        for(int number = 100;number<1000;number++){
            int ge = number%10;
            int shi = number/10%10;
            int bai = number/10/10%10;
            //在判定水仙花数的过程中，满足条件不再输出，更改为修改count的值，使count +1
            if(ge*ge*ge + shi*shi*shi + bai*bai*bai == number){
                count++;
            }
        }
        System.out.println("水仙花共有" + count +"个");
    }
}
